<?php
require_once("conf/db_connection.php");

$truck = $_GET["truck"];
$cell = $_GET["cell"];
$return_str = "";
$status_log_table_list = "";

$query_status_log = "SELECT * FROM status_log WHERE updated_by LIKE '%".$cell ."%' OR truck_id='".$truck."'";
$result_status_log = mysql_query($query_status_log) or die("SELECT STATUS LOG ".mysql_error());
$num_rows_sta = mysql_num_rows($result_status_log);
if($num_rows_sta>0)
{
	while($row_status_log = mysql_fetch_array($result_status_log))
	{
		$status_log_table_list .= "<tr class='h25'>
		<td class='incl label'>".$row_status_log['update_date']."</td>
		<td class='incl label'>".$row_status_log['message']."</td>
		<td class='incl label'>".$row_status_log['updated_by']."</td>
		</tr>";
	}
}
else
{
	$status_log_table_list = "<td class='incl label' colspan='4' style='padding-top:30px;'>No Status Log Record</td>";
}


$return_str = "<div id='div_inc_list' style='margin:25px 25px 0px 25px; padding: 0px auto;width:950px;height:400px;background-color:#FFFFFF;overflow:scroll;'>
<table id='pop_table' border='0' style='width:950px;'>
<thead style='height:15%;'>
<tr id='hor-minimalist-b'>
	<th style='width:25%;'>Date/Time</th>
	<th style='width:50%;'>Message</th>
	<th style='width:25%;'>Updated by</th>
</tr>
</thead>
<tbody>
".$status_log_table_list."
</tbody>
</table>
<input onClick='closePopDiv()' style='width:auto;position:absolute;bottom:20px;left:463px;' type='button' value='Close' />
</div>";

echo $return_str;
?>